<template>
  <t-image-viewer v-if="!store.isMobileType" v-model:visible="ImgVisible" :images="[urls + props.info.value]">
  </t-image-viewer>
  <van-image-preview :show-index="false" v-else v-model:show="ImgVisible" :images="[urls + props.info.value]">
  </van-image-preview>
  <div class="outline-parent jy-style-height border-hover-style">
    <div class="Showroom-parent" v-if="props.info.digitalShowroom">
      <digitalShowroomInfo :url="props.info.digitalShowroom" :id="props.info.id" />
    </div>
    <img
      class="outline-parent-bg"
      :src="publicUrls + 'free/style6/Level1outlineStyle2Bg.webp'"
      alt=""
      v-if="props.info.value"
    />
    <img
      class="outline-parent-bg"
      :src="publicUrls + 'free/style6/Level1outlineStyle2Bg2.webp'"
      alt=""
      v-else
    />
    <div class="outline jy-style-height">
      <div
        class="outline-content"
        :class="
          !props.info.value
            ? 'outline-content-center'
            : !props.info.remarks && props.info.subTitle && props.info.value
            ? 'outline-content-remarks'
            : !props.info.remarks && !props.info.subTitle && props.info.value && 'outline-content-margin'
        "
      >
        <div
          class="content-tiitle"
          :style="{
            'background-image': `url(${publicUrls + 'free/style6/level1style2titlebg.png?imageView2/format/webp'})`,
          }"
          v-html="textType(props.info.text)"
        ></div>
        <div class="text-box">
          <p class="outline-subTitle" v-if="props.info.subTitle">—{{ props.info.subTitle }}</p>
          <TextMax
            v-if="props.domShow"
            :class="!props.info.value && !props.info.subTitle && 'remarks'"
            :data="props.info.remarks"
            :infoData="props.info"
            :title="props.info.text"
            :row="!props.info.value && props.info.subTitle ? 4 : 6"
          ></TextMax>
        </div>
      </div>
    </div>
    <div class="cover-click" v-if="props.info.value" @click="ImgVisible = true"></div>
    <div class="cover" v-if="props.info.value">
      <div class="cover-content">
        <img class="outline-cover" :src="urls + props.info.value + '?imageView2/3/format/webp'" alt="" />
      </div>
    </div>
  </div>
</template> 

<script lang="ts">
export default defineComponent({
  name: 'free6Style2',
});
</script>

<script setup lang="ts">
import ExpandableText from './../../../textMode/ExpandableText.vue';
import digitalShowroomInfo from '@/freeComponents/unitdigitalShowroom/style6.vue';
import { publicUrls } from '@/utils/minxin';
import { textType } from '@/utils/minxin';
import { urls } from '@/utils/request/upload';
import { defineComponent, nextTick, ref } from 'vue';
import TextMax from '@/freeComponents/textMode/TextMax.vue';
import { useProjectStore } from '@/store';
const store = useProjectStore();
const ImgVisible = ref(false);

const props = defineProps({
  info: {
    type: Object,
  },
  domShow: {
    type: Boolean,
  },
});
// 跳转全景链接
const open = (url: any) => {
  if (url) {
    window.open(url, '_blank');
  }
};
</script>

<style scoped lang="less">
.outline-parent {
  position: relative;
  margin-top: 0;
  margin-right: 280px;
}
.outline-parent-bg {
  width: 663px;
  height: calc(100%);
  position: relative;
  z-index: 20;
}
.Showroom-parent {
  position: absolute;
  top: 20px;
  right: 115px;
  z-index: 23;
}
.outline {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 22;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  width: 100%;
}
.outline-content {
  display: flex;
  align-items: center;
  width: 487px;
  margin-top: 70px;
  padding: 0 27px;
}
.outline-content-remarks {
  flex-direction: column;
  margin-top: 20px;
  .content-tiitle {
    margin-bottom: 10px;
  }
  .text-box {
    margin-left: 0;
  }
}
.outline-content-margin {
  flex-direction: column;
  margin-top: 60px;
}
.outline-content-center {
  flex-direction: column;
  margin-top: 45px;
  .content-tiitle {
    margin-bottom: 35px;
  }
  .text-box {
    margin-left: 0;
  }
  .outline-subTitle {
    margin-bottom: 20px;
  }
}
.content-tiitle {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 110px;
  height: 359px;
  background-size: 100% 100%;
  background-repeat: no-repeat;
  padding: 24px 14px;
  ::v-deep p {
    writing-mode: vertical-rl;
    text-orientation: upright;
    letter-spacing: 4px;
    font-family: SourceHanSerifCN-Bold;
    font-size: 30px;
    line-height: 40px;
    text-align: center;
    color: #f1efea;
  }
}

.text-box {
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  margin-left: 24px;
}
.outline-subTitle {
  width: 100%;
  text-align: center;
  font-family: SourceHanSerifCN;
  font-size: 18px;
  line-height: 28px;
  text-align: center;
  color: #f1efea;
  margin-bottom: 40px;
}
.cover-click {
  width: 500px;
  height: 335px;
  position: absolute;
  bottom: 60px;
  left: 50%;
  transform: translate(-50%);
  cursor: pointer;
  z-index: 22;
}
.cover-click:hover + .cover > .cover-content > .outline-cover {
  transform: scale(1.2);
}
.cover {
  width: 487px;
  height: auto;
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translate(-50%);
}
.cover-content {
  width: 100%;
  height: 420px;
  overflow: hidden;
  .outline-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all 0.3s ease;
  }
}
.remarks {
  margin-top: 5px;
}

::v-deep .van-text-ellipsis {
  font-family: PingFang SC !important;
  font-size: 16px !important;
  color: #f1efea !important;
  line-height: 32px !important;
}
::v-deep .van-text-ellipsis__action::before {
  color: #f1efea !important;
  font-weight: 800 !important;
}
</style>